<?php
/**
 * regd by PhpStorm.
 * User: lee
 * Date: 2017/11/29
 * Time: 17:31
 */

namespace Biz\validate;

use Biz\model\ShopBasicInfo as mShopBasicInfo;


class ShopBasicInfo extends \Doraemon\pockets\validate\Base {


    public static function rules() {
        $typeList = array_keys(mShopBasicInfo::$typeDesc);


        return [
            ['type','required',null,'请选择账户类型',['signup']],
            ['type','InList',['list'=>$typeList],'请正确选择账户类型',['signup']],

            ['name','required',null,'小店名称不存在，请填写',['signup']],
            ['name','length','1,30','小店名称太长咯',['signup']],
            ['name','regex',['pattern'=>'/^[\x{4e00}-\x{9fa5}_\-a-zA-Z0-9]+$/u'],'请正确填写小店名称',['signup']],


            ['intro','required',null,'请填写商家简介',['adminop','update']],
            ['intro','length','1,100','请正确填写商家简介',['adminop','update']],

        ];

    }

}